package atguigu.nio.buffer;

import java.io.*;

public class BufferDemo1 {

    public static void main(String[] args) {
        try {
            InputStream is = new FileInputStream("d://GEAMAssetCardPub-GEAM设备台帐信息.xls");
            InputStream bis = new BufferedInputStream(is);
            OutputStream os = new FileOutputStream("d://GEAMAssetCardPub-GEAM设备台帐信息_1.xls");
            OutputStream bos = new BufferedOutputStream(os);
            int len;
            byte []buffer = new byte[1024];
            while ((len = bis.read(buffer))!=-1) {
                bos.write(buffer, 0, len);
                bos.flush();
            }
            bis.close();
            bos.close();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
